<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOrganizesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('organizes', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('organize_num')->comment('组织编码');
            $table->string('organize_name')->comment('组织名');
            $table->string('organize_desc')->comment('组织描述');
            $table->string('p_organize_num')->comment('上级组织编码');
            $table->unique('organize_num');
            $table->index('organize_name');
            $table->index('p_organize_num');
            $table->timestamps();
            $table->softDeletes();
            $table->engine = "InnoDB";
            $table->charset = 'utf8mb4';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('organizes');
    }
}
